SUPERTREND ATR WITH TRAILING STOP LOSS## THIS SCRIPT IS ON GITHUB
## MORE BACKTEST
SuperTrend is a moving stop and reversal line based on the volatility (ATR).
The strategy will ride up your stop loss when price moviment 1%.
The strategy will close your operation when the market price crossed the stop loss.
The strategy will close operation when the line based on the volatility will crossed
The strategy has the following parameters:
+ **ATR PERIOD** - To select number of bars back to execute calculation
+ **ATR MULTPLIER** - To add a multplier factor on volatility
+ **INITIAL STOP LOSS** - Where can isert the value to first stop.
+ **POSITION TYPE** - Where can to select trade position.
+ **BACKTEST PERIOD** - To select range.
## DISCLAIMER
1. I am not licensed financial advisors or broker dealers. I do not tell you when or what to buy or sell. I developed this software which enables you execute manual or automated trades multiple trades using TradingView. The software allows you to set the criteria you want for entering and exiting trades.
2. Do not trade with money you cannot afford to lose.
3. I do not guarantee consistent profits or that anyone can make money with no effort. And I am not selling the holy grail.
4. Every system can have winning and losing streaks.
5. Money management plays a large role in the results of your trading. For example: lot size, account size, broker leverage, and broker margin call rules all have an effect on results. Also, your Take Profit and Stop Loss settings for individual pair trades and for overall account equity have a major impact on results. If you are new to trading and do not understand these items, then I recommend you seek education materials to further your knowledge.
**YOU NEED TO FIND AND USE THE TRADING SYSTEM THAT WORKS BEST FOR YOU AND YOUR TRADING TOLERANCE.**
**I HAVE PROVIDED NOTHING MORE THAN A TOOL WITH OPTIONS FOR YOU TO TRADE WITH THIS PROGRAM ON TRADINGVIEW.**
## NOTE
I accept suggestions to improve the script.
If you encounter any problems i will be happy to share with me.
+ Authors: @exit490
+ Revision: v1.0.0
+ Date: 5-Aug-2019
+ Pinescript version: 4
## LICENSE
Copyright 2019 Mauricio Pimenta / exit490
SuperTrend with Trailing Stop Loss script may be freely distributed under the (../LICENSE).
在腳本中搜尋"the strat"
TRAILING STOP LOSS TO LONG AND SHORT##THIS SCRIPT IS ON GITHUB
This TradingView strategy it is designed to integrate with other strategies with indicators.
It performs a trailing stop loss from entry and exit conditions.
In this strategy you can add conditions for long and short positions.
The strategy will ride up your stop loss when price moviment 1%.
The strategy will close your operation when the market price crossed the stop loss.
Also is possible to select the period that strategy will execute the backtest.
The strategy has the following parameters:
+ **INITIAL STOP LOSS** - Where can isert the value to first stop.
+ **POSITION TYPE** - Where can to select trade position.
+ **BACKTEST PERIOD** - To select range.
## DISCLAIMER
1. I am not licensed financial advisors or broker dealers. I do not tell you when or what to buy or sell. I developed this software which enables you execute manual or automated trades multiple trades using TradingView. The software allows you to set the criteria you want for entering and exiting trades.
2. Do not trade with money you cannot afford to lose.
3. I do not guarantee consistent profits or that anyone can make money with no effort. And I am not selling the holy grail.
4. Every system can have winning and losing streaks.
5. Money management plays a large role in the results of your trading. For example: lot size, account size, broker leverage, and broker margin call rules all have an effect on results. Also, your Take Profit and Stop Loss settings for individual pair trades and for overall account equity have a major impact on results. If you are new to trading and do not understand these items, then I recommend you seek education materials to further your knowledge.
**YOU NEED TO FIND AND USE THE TRADING SYSTEM THAT WORKS BEST FOR YOU AND YOUR TRADING TOLERANCE.**
**I HAVE PROVIDED NOTHING MORE THAN A TOOL WITH OPTIONS FOR YOU TO TRADE WITH THIS PROGRAM ON TRADINGVIEW.**
## NOTE
I accept suggestions to improve the script.
If you encounter any problems I will be happy to share with me.
+ Authors: @exit490
+ Revision: v1.0.0
+ Date: 03-Aug-2019
+ Pinescript version: 4
## LICENSE
Copyright 2019 Mauricio Pimenta / exit490
Trailing Stop Loss script may be freely distributed under the MIT license .
Combo Backtest 123 Reversal & Chaikin Volatility This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Chaikin's Volatility indicator compares the spread between a security's
high and low prices. It quantifies volatility as a widening of the range
between the high and the low price.
You can use in the xPrice1 and xPrice2 any series: Open, High, Low, Close, HL2,
HLC3, OHLC4 and ect...
WARNING:
- For purpose educate only
- This script to change bars colors.
Combo Backtest 123 Reversal & Center Of Gravity This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
The indicator is based on moving averages. On the basis of these, the
"center" of the price is calculated, and price channels are also constructed,
which act as corridors for the asset quotations.
WARNING:
- For purpose educate only
- This script to change bars colors.
Combo Backtest 123 Reversal & Bull Power This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
Bull Power Indicator
To get more information please see "Bull And Bear Balance Indicator"
by Vadim Gimelfarb.
WARNING:
- For purpose educate only
- This script to change bars colors.
Combo Backtest 123 Reversal & Bull And Bear Balance This is combo strategies for get a cumulative signal.
First strategy
This System was created from the Book "How I Tripled My Money In The
Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
The strategy buys at market, if close price is higher than the previous close
during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50.
The strategy sells at market, if close price is lower than the previous close price
during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
Second strategy
This new indicator analyzes the balance between bullish and
bearish sentiment.
One can cay that it is an improved analogue of Elder Ray indicator.
To get more information please see "Bull And Bear Balance Indicator"
by Vadim Gimelfarb.
WARNING:
- For purpose educate only
- This script to change bars colors.
MACD/EMA/SMA/Ichimoku Confluence StrategyThis strategy uses a number of chart indicators to provide a Bullish/Bearish signal. Using a combination of the 200 SMA, the 20 EMA, the MACD and the Ichimoku cloud, the strategy logic will adjust the amount of confluence required between the indicators depending on how bullish or bearish the chart is looking. The logic looks for the following:
- Are we above or below the 200 SMA?
- Are we above or below the 20 EMA?
- Have we had a bullish MACD cross?
- Where are we in relation to the Ichimoku cloud?
If the coin is below the 200 SMA, then the strategy will only give a buy signal if the coin closes a candle above the 20 EMA AND the MACD is bullish and either the Ichimoku cloud is green, or the coin is above the Ichimoku cloud (regardless of colour).
If the coin is above the 200 SMA, Then the strategy will give a buy signal if the coin closes a candle above the 20 EMA AND the MACD is bullish and the coin is either IN the cloud (not necessarily above it) or the cloud is green.
The reverse is true for a sell signal, i.e. when the coin is above the 200 SMA it must close a candle below the Ichimoku cloud and be bearish in relation to the 20 EMA and MACD. If it is below the 200 SMA, then the strategy will give a sell signal if the the EMA/MACD conditions are true and the coin enters the cloud.
This strategy gives a fairly conservative signal for entry and exit points, but is fairly successful across a number of time frames, both short term and long term. As with all my strategies, I only include LONG entries and closes, not SHORT entries (as I find they make for inaccurate backtesting).
Please feel free to like, share, critique and suggest any improvements to this strategy. All feedback, positive and negative, is appreciated.
Peak Valley Estimation StrategyIntroduction
Its the first strategy that i post here, so don't expect ground breaking stuff, when testing my indicators i always used prorealtime and not tradingview. This strategy use signals generated by the peak/valley estimator indicator i posted long ago, i think the signals generated where sometimes quite accurate in some markets thus providing potential material for a profitable strategy.
The indicator use 3 parameters, therefore the optimisation process is not easy, but i selected what i judged good parameters values at first glance. The strategy is in its more simple form without stop or anything, the detection of peaks and valley can allow for tighter stops since we expect the price to reverse, but take into account that sops and take profits are parameters subject to optimization process except if selected with strict money management rules and not profit optimization.
Of course trading the strategy in this form is far from being great, if we take into account the market non stationarity then we might expect loss during trending markets. Trend strength indicators could help switch from a reversal to breakout strategy thus maybe providing more control.
I really hope you find an use for the strategy.
Notes
Its been three long years since i started tradingview, and i put more efforts in my indicators than in my studies and life overall, this have created complicated situations and i can't afford to follow up with this, therefore i announce that in the end of june i will leave tradingview for quite a long time, at least until i have my degree. I announce it in advance in case some of you want helps of any kind. I will post all the indicators, both in progress and finished i have made during those three years. I hope you can all understand.
Thanks for reading !
Efficient PriceTrading The Movements That Matters
Inspired by the Price Volume Trend indicator the Efficient Price aim to create a better version of the price containing only the information a trend trader must need.
Calculation
This indicator use the Efficiency Ratio as a smoothing constant, it is calculated as follow :
ER = abs(change(close,length))/sum(abs(change(close)),length)
The goal of the Efficiency Ratio is to show if the market is trending or ranging.If ER is high then the market is considered to be trending, if ER is low then the market is considered to be ranging.
Then the Efficient Price is calculated :
EP = cum(change(close)*ER)
When the price is trending, the indicator will show movements of the price with unchanged volatility, but if the price is not trending then the indicator will flatten those movements.Think of this indicator as both a filter and a compressor and the Efficient Price as some kind of threshold.
The Efficient Price As Input For Indicators/Strategies
If the indicator show the movement of the trending price, it can be interesting to use it as input in order to reduce the number of false signals in a strategy.
We will test 2 MACD strategy provided by tradingview, one using the closing price (In Red) and one with the efficient price (In White) as input
with both the following parameters :
fastLength = 50
slowlength = 200
MACDLength = 20
length = 50
Where length is the parameter of the Efficient Price.A spread of 2 pips is used.
Without Efficient Price : 26.88% of profitability, 69 pips of profit.
With Efficient Price : 38.46% of profitability, 336 pips of profit.
The difference of profitability is of 11.58%, the strategy with the Efficient Price made few trades and its equity have a lower variance than the equity of the MACD strategy using closing price.
Smoothed Version
It is possible to smooth the indicator output by using the following code :
EP = cum(change(close,length)*ER)
Hope you enjoy
For any questions/demands feel free to pm me, i would be happy to help you
MASelect Crossover AlertsStudy for alerts, to be used with the MASelect Crossover Strat.
A simple crossover/crossunder strategy for beginners with options for 5 types of Moving Average. Use the strategy script to backtest and find your preferred Moving Average combinations and lengths.
Moving Average Cross and/or Bbands botHello TradingView and world!
This is one of our latest concepts for an actual bot builder. This script comes with a bunch of features that we're hoping will alleviate a lot of the stress and confusion around using and building strategies here on TV. Especially if the end-goal is to automate the strategies using Autoview.
This is a combination of 2 strategies, and gives you full control of each component within the script.
The 2 strategies are:
2 Moving Averages == if close is greater than moving average and moving average 1 is greater than moving average 2
Bolling Bands == if close is less than lower or greater than upper
Features / Settings included :
- Ability to change settings from a commodity market (default) to an altcoin or forex market.
- Backtest time period selector component
- Heiken Ashi Candles on/off
- Moving Average Strategy on/off
- Bollinger Bands Strategy on/off
- Both Moving Average settings can be adjusted
- Bollinger Bands length and multiplier can be adjusted.
- Pyramiding Greater Than, Equal To, or Less Than
- Trailing Stop with the ability to set a price in which the Trailing Stop activate
- Take Profit on/off and editable
- Stop Loss on/off and editable
- Margin Call on/off dependent on Leverage which is editable
- If pyramiding is used, the strategy will calculate and display your average on the chart
- Profit and Loss visuals added to the chart
You can watch a video here on how all the settings can be used and work together.
www.youtube.com
You can learn more about Autoview here:
autoview.with.pink
Get your invite and join us in slack here:
slack.with.pink
Heiken Ashi + Ichimoku Kinko Hyo StrategyHeikin-Ashi:
Instead of using the open-high-low-close (OHLC) bars like standard candlestick charts, it uses a modified formula. Out of which only following two are used in this strategy.
High = Max (High,Open,Close)
Low = Min (Low,Open, Close)
Ichimoku Kinko Hyo:
The Ichimoku Kinko Hyo system includes five kinds of signal, of which this strategy uses four signals i.e. Tenkan Sen / Kijun Sen Cross, price crosses the Kijun Sen, Chikou Span and Kumo. Although the Chikou Span, Senkou Span A and Senkou Span B (Kumo) are shifted into the past/future, these trigger signals enhances the strategy.
The Tenkan Sen, also known as the Turning or Conversion line, is a moving average of the highest high and lowest low over the last 9 periods in this strategy.
The Kijun Sen, also known as the Standard or Base line, is a moving average of the highest high and lowest low over the last 24 periods in this strategy.
The Chikou Span, also known as the Lagging line, is the closing price plotted 24 periods behind in this strategy.
The Senkou Span A, also known as the 1st leading line, is a moving average of the Tenkan Sen and Kijun Sen and is plotted 24 periods ahead in this strategy.
The Senkou Span B, also known as the 2nd leading line, is a moving average of the highest high and lowest low over the last 51 trading days is plotted 24 periods ahead in this strategy.
Hull MA-X + Ichimoku Kinko Hyo StrategyHull MA-X:
The Hull MA involves the weighted moving average ( WMA ) in its calculation.
First, calculate the WMA with period (n / 2) and multiply this by 2. Remember ‘n’ is the time period configurable based on the trader’s requirement.
Second, calculate the WMA for period “n” and subtract if from the first step. Thirdly, calculate the weighted moving average with period sqrt (n) using the data from the second step. You can take a look at the below formula:
Hull MA= WMA (2*WMA (n/2) − WMA (n)), sqrt (n))
The default setting is 12 periods in this strategy, fast Hull MA crossing slow Hull MA will generate a circle on charts.
Ichimoku Kinko Hyo:
The Ichimoku Kinko Hyo system includes five kinds of signal, of which this strategy uses four signals i.e. Tenkan Sen / Kijun Sen Cross, price crosses the Kijun Sen, Chikou Span and Kumo. Although the Chikou Span, Senkou Span A and Senkou Span B (Kumo) are shifted into the past/future, these trigger signals enhances the strategy.
The Tenkan Sen, also known as the Turning or Conversion line, is a moving average of the highest high and lowest low over the last 9 periods in this strategy.
The Kijun Sen, also known as the Standard or Base line, is a moving average of the highest high and lowest low over the last 24 periods in this strategy.
The Chikou Span, also known as the Lagging line, is the closing price plotted 24 periods behind in this strategy.
The Senkou Span A, also known as the 1st leading line, is a moving average of the Tenkan Sen and Kijun Sen and is plotted 24 periods ahead in this strategy.
The Senkou Span B, also known as the 2nd leading line, is a moving average of the highest high and lowest low over the last 51 trading days is plotted 24 periods ahead in this strategy.
As with most technical analysis methods, Ichimoku is likely to produce frequent conflicting signals in non-trending markets, So in addition to Ichimoku Kinko Hyo, the Hull MA is used, which is popular amongst some day traders, in combination it attempts to give an accurate signal by eliminating lags and improving the smoothness of the line.
The Hull MA Cross in combination with Ichimoku Kinko Hyo signals tries to give an accurate signal by eliminating lags and improve the smoothness of price activity. Please note that price trends can and do change often, so your readings of the charts and this trading system should be probabilistic, rather than predictive.
Ichimoku Kinko Hyo + HULL-MA_X + MacDThe Ichimoku Kinko Hyo system includes five kinds of signal, of which this strategy uses the most recent of ones i.e. Tenkan Sen / Kijun Sen Cross and price crosses the Kijun Sen. As the Chikou Span, Senkou Span A and Senkou Span B are shifted into the past/future, the trigger signals will be only be used for visual confirmation and not part of the strategy.
The Tenkan Sen, also known as the Turning or Conversion line, is a moving average of the highest high and lowest low over the last 9 periods in this strategy.
The Kijun Sen, also known as the Standard or Base line, is a moving average of the highest high and lowest low over the last 24 periods in this strategy.
The Chikou Span, also known as the Lagging line, is the closing price plotted 24 periods behind in this strategy.
The Senkou Span A, also known as the 1st leading line, is a moving average of the Tenkan Sen and Kijun Sen and is plotted 24 periods ahead in this strategy.
The Senkou Span B, also known as the 2nd leading line, is a moving average of the highest high and lowest low over the last 51 trading days is plotted 24 periods ahead in this strategy.
Moving average convergence divergence (MaCD) is a trend-following momentum indicator that shows the relationship between two moving averages of prices. The MaCD is calculated in this strategy by subtracting the 24-day exponential moving average (EMA) from the 12-day EMA. A nine-day EMA of the MACD, called the "signal line", aMaCD in this case, is then plotted on top of the MaCD. In this strategy, MaCD/ aMaCD Cross is functioning as a trigger for buy and sell signals.
As with most technical analysis methods, Ichimoku is likely to produce frequent conflicting signals in non-trending markets, So in addition to Ichimoku Kinko Hyo, the Hull MA is popular amongst some day traders, as the indicator which in combination with MaCD attempts to give an accurate signal by eliminating lags and improving the smoothness of the line.
Alan Hull, developed this moving average indicator and hence it’s called the Hull MA.
Now, let’s dissect how the Hull moving average is calculated.
The Hull MA involves the weighted moving average (WMA) in its calculation.
First, calculate the WMA with period (n / 2) and multiply this by 2. Remember ‘n’ is the time period configurable based on the trader’s requirement. The default setting is 12 periods in this strategy, fast Hull MA crossing slow Hull MA will generate a circle on charts.
Second, calculate the WMA for period “n” and subtract if from the first step. Thirdly, calculate the weighted moving average with period sqrt (n) using the data from the second step. You can take a look at the below formula:
Hull MA= WMA (2*WMA (n/2) − WMA (n)), sqrt (n))
The Hull MA Cross in combination with Tenkan Sen / Kijun Sen Cross and MaCD tries to give an accurate signal by eliminating lags and improve the smoothness of price activity. Please note that price trends can and do change often, so your readings of the charts and this trading system should be probabilistic, rather than predictive.
alert!!!!alerts work over values of plots on the chart. could not find a way to add an alert when a strategy is triggered.
so, i created an alert chart that uses the same conditions as the strategy(i published the example strat in my previous script). an alert chart should be mostly zero, but when the strat fires up, the alert = 1, and when the strat fires down, alert = -1. this way it's easy to check the chart for alerts.
but, if i'm looking at the cahrt and see the strat's arrows, what's the point? well, the point is that we can add alerts to this chart, to send emails, popup on screen, start screaming, whatever. so that now i don't actually need the chart in screen all the time :)
since this alert chart behaves so nice, values = to add an alert is just setting it's value >0.5, or value > -0.5 :)
note: aloert is not actually in the script, it has to be added manually using the button. if Pine has a way to add alerts programatically, i couldn't find it
Strategy Code Example - Risk Management*** THIS IS JUST AN EXAMPLE OF STRATEGY RISK MANAGEMENT CODE IMPLEMENTATION ***
For my own future reference, and for anyone else who needs it.
Pine script strategy code can be confusing and awkward, so I finally sat down and had a little think about it and put something together that actually works (i think...)
Code is commented where I felt might be necessary (pretty much everything..) and covers:
Take Profit
Stop Loss
Trailing Stop
Trailing Stop Offset
...and details how to handle the input values for these in a way that allows them to be disabled if set to 0, without breaking the strategy.exit functionality or requiring a silly amount of statement nesting.
Also shows how to use functions (or variables/series) to execute trade entries and exits.
Cheers!
Everyday 0003 _ MAC Pullback I recently posted a Moving Averge Crossover strategy for my Everyday project - a project I've given myself where I try to create one strategy everyday in between 15 minutes and 2 hours.
In the comments of my last published idea, user SignalTradersUK was very kind and suggested I try the following in my next study:
"i think your next study should be, to workout what to do after the Moving Average cross! If you look just on the chart you have posted, Price would appear to always come back to the levels where the 2 MA's cross and then go back in the direction of the crossing of the MA's. It's a great pull back strategy."
I'm really just beginning to learn about coding strategies so I'm not 100% sure I correctly understood his suggestion.
I admit I had difficulties wrapping my head around how to do this.
Anyway, the result is a strategy which runs alongside the main Moving Average Crossover.
'The Algorithm'
When the fast and slow MA cross the strategy traces back 40 days to find a swing low.
This swing low and the price at the MA cross is used to calculate a fib 1.272 extension.
The price at this 1.272 extension is used to place a Pullback short order.
Since we're shorting a bull trend, a tight stop is used.
If the pullback reaches down to the fib 0.618 we take profit (close the short).
Like I said, I don't know if I correctly understood SignalTradersUK feedback, but I really appreciate the
feedback and advice!
As always I'm hoping to learn from the community, so all feedback, corrections and advice is very welcome!
Thanks!
/pbergden
Binary Options Strategy Testing ScriptThis is a script for testing binary options trading strategies. To test a strategy, modify the 'go_down' or 'go_up' booleans. These SHOULD NOT access any current values (for example, 'ohlc4' or 'close '), or the backtesting will not be an accurate representation of the forward values.
Modify the fraction_return input to be the return rate of the option on success. This is assumed to be a true 100 or 0 option- i.e. if the choice is not correct, there is a 100% loss.
The strategy in place is merely an example, and as you can see, has a very negative rate of return when implemented as a strategy.
Please comment in your code if you use this in any future posts. Thanks!
Outsidebar vs Insidebar, Illusion Strategy (by ChartArt)WARNING: This strategy does not work! Please don't trade with this strategy
I'm sharing this strategy for the following three educational reasons:
1. You can easily find 100% strategies, but if they only seem to work 100% on one asset, they actually don't work at all. Therefore never backtest your strategy only on one asset, especially forward testing is useless, because it tends to repeat the old patterns. Your strategy has to work on as many different assets as possible.
2. The pyramiding of orders can have an impact on the strategy. In this case if you manually change the strategy settings by increasing it from 1 to 100 pyramiding orders changes the percent profitable on "UKOIL" monthly from 100% to 90% profitable. On other assets you can see very different results. Allowing much more pyramiding orders in this case results in opening orders where the background color highlights appear.
3. The Tradingview backtest beta version currently does not close the last open trade during the backtest. In this case going long on "UKOIL" near the top in 2011 as this strategy did would result in a big loss in 2015. But since the trade is still open and not canceled out by a new short order it still appears as if this strategy works 100% profitable. Which it doesn't.
MACD + SMA 200 Strategy (by ChartArt)Here is a combination of the classic MACD (moving average convergence divergence indicator) with the classic slow moving average SMA with period 200 together as a strategy.
This strategy goes long if the MACD histogram and the MACD momentum are both above zero and the fast MACD moving average is above the slow MACD moving average. As additional long filter the recent price has to be above the SMA 200. If the inverse logic is true, the strategy goes short. For the worst case there is a max intraday equity loss of 50% filter.
Save another $999 bucks with my free strategy.
This strategy works in the backtest on the daily chart of Bitcoin, as well as on the S&P 500 and the Dow Jones Industrial Average daily charts. Current performance as of November 30, 2015 on the SPX500 CFD daily is percent profitable: 68% since the year 1970 with a profit factor of 6.4. Current performance as of November 30, 2015 on the DOWI index daily is percent profitable: 51% since the year 1915 with a profit factor of 10.8.
All trading involves high risk; past performance is not necessarily indicative of future results. Hypothetical or simulated performance results have certain inherent limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not actually been executed, the results may have under- or over-compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown.
How to automate this strategy for free using a chrome extension.Hey everyone,
Recently we developed a chrome extension for automating TradingView strategies using the alerts they provide. Initially we were charging a monthly fee for the extension, but we have now decided to make it FREE for everyone. So to display the power of automating strategies via TradingView, we figured we would also provide a profitable strategy along with the custom alert script and commands for the alerts so you can easily cut and paste to begin trading for profit while you sleep.
Step 1:
You are going to need to download the Chrome Extension called AutoView. You can get the extension for free by following this link: bit.ly ( I had to shorten the link as it contains Google and TV automatically converts it to a symbol)
Step 2: Go to your chrome extension page, and under the new extension you'll see a "settings" button. In the setting you will have to connect and give permission to the exchange 1broker allowing the extension to place your orders automatically when triggered by an alert.
Step 3: Setup the strategy and custom script for the alerts in TradingView. The attached script is the strategy, you can play with the settings yourself to try and get better numbers/performance if you please.
This following script is for the custom alerts:
//@version=2
study("4All-Alert", shorttitle="Alerts")
src = close
len = input(4, minval=1, title="Length")
up = rma(max(change(src), 0), len)
down = rma(-min(change(src), 0), len)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
rsin = input(5)
sn = 100 - rsin
ln = 0 + rsin
short = crossover(rsi, sn) ? 1 : 0
long = crossunder(rsi, ln) ? 1 : 0
plot(long, "Long", color=green)
plot(short, "Short", color=red)
Now that you have the extension installed, the custom strategy and alert scripts in place, you simply need to create the alerts.
To get the alerts to communicate with the extension properly, there is a specific syntax that you will need to put in the message of the alert. You can find more details about the syntax here : gist.github.com
For this specific strategy, I use the Alerts script, long/short greater than 0.9 on close.
In the message for a long place this as your message:
Long
c=order b=short
c=position b=short l=200 t=market
b=long q=0.01 l=200 t=market tp=13 sl=25
and for the short...
Short
c=order b=long
c=position b=long l=200 t=market
b=short q=0.01 l=200 t=market tp=13 sl=25
If you'll notice in my above messages, compared to the strategy my tp and sl (take profit and stop loss) vary by a few pips. This is to cover the market opens and spread on 1broker. You can change the tp and sl in the strategy to the above and see that the overall profit will not vary much at all.
I hope this all makes sense and it is enough to not only make some people money, but to show the power of coming up with your own strategy and automating it using TradingView alerts and the free Chrome Extension AutoView.
ps. I highly recommend upgrading your TradingView account so you have access to back testing and multiple alerts.
There is really no reason you won't cover the cost and then some on a monthly basis using the tools provided.
Best of luck and happy trading.
Note: The extension currently allows for automation on 2 exchanges; 1broker and Okcoin. If you do not have accounts there, we'd appreciate you signing up using our referral links.
www.okcoin.com
1broker.com
CM Stochastic POP Method 2-Jake Bernstein_V1Yesterday Jake Bernstein authorized me to post his updated results with the Stochastic Pop Trading System he developed many years ago.
You can take a look at the Original System with Updated Settings at
This indicator is a different set of rules Jake mentioned in the PDF he allowed me to post.
To view the PDF use this link:
dl.dropboxusercontent.com
Today we’re releasing the version described in the PDF that uses the StochK values of 55, 50, and 45. The rules are discussed in the PDF but here is a simple breakdown:
Enter Long when StochK is below 50 and Crosses Above 55
Exit Long on Cross Below 55
Enter Short when StochK is Above 50 and crosses Below 45
Exit Short on Cross Above 45
Two Important Items to understand about this method:
To code the rules Precisely we need a function that will be available when Strategy Capabilities are released on TradingView.
There is one of Jakes Profit Maximizing Strategies that needs to be integrated with this code…which again we need the Strategy based Function that will be coming soon.
To Compare this system to the Stochastic Pop Method 1 System shown yesterday at I used the same Symbol and dates for you to compare…but remember to give this Method 2 System a Fair Look/Evaluation…we need the Soon To Be Released…TradingView Strategy Capabilities.
BackTesting Results Example: EUR-USD Daily Chart Since 01/01/2005
Strategy 1 – Stochastic Pop Method 2 System:
Go Long When Stochasticis below 50 and Crosses Above 55. Go Short When Stochastic is above 50 and Crosses Below 45. Exit Long/Short When Stochastic has a Reverse Cross of Entry Value.
Results:
Total Trades = 151
Profit = 40,758 Pips
Win% = 37.1%
Profit Factor = 1.26
Avg Trade = 270 Pips Profit
***Most Consecutive Wins = 4 ... Most Consecutive Losses = 7
Strategy 2:
Rules - Proprietary Optimization Jake Will Teach. Only Added 1 Additional Exit Rule.
Results:
Total Trades = 151
Profit = 60.305 Pips
Win% = 37.1%
Profit Factor = 1.38
Avg Trade = 399 Pips Profit
***Most Consecutive Wins = 4 ... Most Consecutive Losses = 7
Indicator Includes:
-Ability to Color Candles (CheckBox In Inputs Tab)
Green = Long Trade
Blue = No Trade
Red = Short Trade
Jake Bernstein will be a contributor on TradingView when Backtesting/Strategies are released. Jake is one of the Top Trading System Developers in the world with 45+ years experience and he is going to teach TradingView.com’s community how to create Trading Systems and how to Optimize the correct way.
Link To PDF:
dl.dropboxusercontent.com
Link to Original Version of Indicator with Updated Settings.
OBV ATR Strategy (OBV Breakout Channel) bas20230503ผมแก้ไขจาก OBV+SMA อันเดิม ของเดิม ดูที่เส้น SMA สองเส้นตัดกันมั่นห่วยแตกสำหรับที่ผมลองเทรดจริง และหลักการเบรค ได้แรงบันดาลใจ ATR จาก เทพคอย ที่ใช้กับราคา แต่นี้ใช้กับ OBV แทน
และผมใช้เจมินี้ เพื่อแก้ ให้ เป็น strategy เพื่อเช็คย้อนหลังได้ง่ายกว่าเดิม
หลักการง่ายคือถ้ามันขึ้น มันจะขึ้นเรื่อยๆ
เขียน แบบสุภาพ (น่าจะอ่านได้ง่ายกว่าผมเขียน)
สคริปต์นี้ได้รับการพัฒนาต่อยอดจากแนวคิด OBV+SMA Crossover แบบดั้งเดิม ซึ่งจากการทดสอบส่วนตัวพบว่าประสิทธิภาพยังไม่น่าพอใจ กลยุทธ์ใหม่นี้จึงเปลี่ยนมาใช้หลักการ "Breakout" ซึ่งได้รับแรงบันดาลใจมาจากการใช้ ATR สร้างกรอบของราคา แต่เราได้นำมาประยุกต์ใช้กับ On-Balance Volume (OBV) แทน นอกจากนี้ สคริปต์ได้ถูกแปลงเป็น Strategy เต็มรูปแบบ (โดยความช่วยเหลือจาก Gemini AI) เพื่อให้สามารถทดสอบย้อนหลัง (Backtest) และประเมินประสิทธิภาพได้อย่างแม่นยำ
หลักการของกลยุทธ์: กลยุทธ์นี้ทำงานบนแนวคิดโมเมนตัมที่ว่า "เมื่อแนวโน้มได้เกิดขึ้นแล้ว มีโอกาสที่มันจะดำเนินต่อไป" โดยจะมองหาการทะลุของพลังซื้อ-ขาย (OBV) ที่แข็งแกร่งเป็นพิเศษเป็นสัญญาณเข้าเทร
----
สคริปต์นี้เป็นกลยุทธ์ (Strategy) ที่ใช้ On-Balance Volume (OBV) ซึ่งเป็นอินดิเคเตอร์ที่วัดแรงซื้อและแรงขายสะสม แทนที่จะใช้การตัดกันของเส้นค่าเฉลี่ย (SMA Crossover) ที่เป็นแบบพื้นฐาน กลยุทธ์นี้จะมองหาการ "ทะลุ" (Breakout) ของพลัง OBV ออกจากกรอบสูงสุด-ต่ำสุดของตัวเองในรอบที่ผ่านมา
สัญญาณกระทิง (Bull Signal): เกิดขึ้นเมื่อพลังการซื้อ (OBV) แข็งแกร่งจนสามารถทะลุจุดสูงสุดของตัวเองในอดีตได้ บ่งบอกถึงโอกาสที่แนวโน้มจะเปลี่ยนเป็นขาขึ้น
สัญญาณหมี (Bear Signal): เกิดขึ้นเมื่อพลังการขาย (OBV) รุนแรงจนสามารถกดดันให้ OBV ทะลุจุดต่ำสุดของตัวเองในอดีตได้ บ่งบอกถึงโอกาสที่แนวโน้มจะเปลี่ยนเป็นขาลง
ส่วนประกอบบนกราฟ (Indicator Components)
เส้น OBV
เส้นหลัก ที่เปลี่ยนเขียวเป็นแดง เป็นทั้งแนวรับและแนวต้าน และ จุด stop loss
เส้นนี้คือหัวใจของอินดิเคเตอร์ ที่แสดงถึงพลังสะสมของ Volume
เมื่อเส้นเป็นสีเขียว (แนวรับ): จะปรากฏขึ้นเมื่อกลยุทธ์เข้าสู่ "โหมดกระทิง" เส้นนี้คือระดับต่ำสุดของ OBV ในอดีต และทำหน้าที่เป็นแนวรับไดนามิก
เมื่อเส้นกลายเป็นสีแดงสีแดง (แนวต้าน): จะปรากฏขึ้นเมื่อกลยุทธ์เข้าสู่ "โหมดหมี" เส้นนี้คือระดับสูงสุดของ OBV ในอดีต และทำหน้าที่เป็นแนวต้านไดนามิก
สัญลักษณ์สัญญาณ (Signal Markers):
Bull 🔼 (สามเหลี่ยมขึ้นสีเขียว): คือสัญญาณ "เข้าซื้อ" (Long) จะปรากฏขึ้น ณ จุดที่ OBV ทะลุขึ้นไปเหนือกรอบด้านบนเป็นครั้งแรก
Bear 🔽 (สามเหลี่ยมลงสีแดง): คือสัญญาณ "เข้าขาย" (Short) จะปรากฏขึ้น ณ จุดที่ OBV ทะลุลงไปต่ำกว่ากรอบด้านล่างเป็นครั้งแรก
วิธีการใช้งาน (How to Use)
เพิ่มสคริปต์นี้ลงบนกราฟราคาที่คุณสนใจ
ไปที่แท็บ "Strategy Tester" ด้านล่างของ TradingView เพื่อดูผลการทดสอบย้อนหลัง (Backtest) ของกลยุทธ์บนสินทรัพย์และไทม์เฟรมต่างๆ
ใช้สัญลักษณ์ "Bull" และ "Bear" เป็นตัวช่วยในการตัดสินใจเข้าเทรด
ข้อควรจำ: ไม่มีกลยุทธ์ใดที่สมบูรณ์แบบ 100% ควรใช้สคริปต์นี้ร่วมกับการวิเคราะห์ปัจจัยอื่นๆ เช่น โครงสร้างราคา, แนวรับ-แนวต้านของราคา และการบริหารความเสี่ยง (Risk Management) ของตัวคุณเองเสมอ
การตั้งค่า (Inputs)
SMA Length 1 / SMA Length 2: ใช้สำหรับพล็อตเส้นค่าเฉลี่ยของ OBV เพื่อดูเป็นภาพอ้างอิง ไม่มีผลต่อตรรกะการเข้า-ออกของ Strategy อันใหม่ แต่มันเป็นของเก่า ถ้าชอบ ก็ใช้ได้ เมื่อ SMA สองเส้นตัดกัน หรือตัดกับเส้น OBV
High/Low Lookback Length: (ค่าพื้นฐาน30/แก้ตรงนี้ให้เหมาะสมกับ coin หรือหุ้น ตามความผันผวน ) คือระยะเวลาที่ใช้ในการคำนวณกรอบสูงสุด-ต่ำสุดของ OBV
ค่าน้อย: ทำให้กรอบแคบลง สัญญาณจะเกิดไวและบ่อยขึ้น แต่อาจมีสัญญาณหลอก (False Signal) เยอะขึ้น
ค่ามาก: ทำให้กรอบกว้างขึ้น สัญญาณจะเกิดช้าลงและน้อยลง แต่มีแนวโน้มที่จะเป็นสัญญาณที่แข็งแกร่งกว่า
แน่นอนครับ นี่คือคำแปลฉบับภาษาอังกฤษที่สรุปใจความสำคัญ กระชับ และสุภาพ เหมาะสำหรับนำไปใช้ในคำอธิบายสคริปต์ (Description) ของ TradingView ครับ
---Translate to English---
OBV Breakout Channel Strategy
This script is an evolution of a traditional OBV+SMA Crossover concept. Through personal testing, the original crossover method was found to have unsatisfactory performance. This new strategy, therefore, uses a "Breakout" principle. The inspiration comes from using ATR to create price channels, but this concept has been adapted and applied to On-Balance Volume (OBV) instead.
Furthermore, the script has been converted into a full Strategy (with assistance from Gemini AI) to enable precise backtesting and performance evaluation.
The strategy's core principle is momentum-based: "once a trend is established, it is likely to continue." It seeks to enter trades on exceptionally strong breakouts of buying or selling pressure as measured by OBV.
Core Concept
This is a Strategy that uses On-Balance Volume (OBV), an indicator that measures cumulative buying and selling pressure. Instead of relying on a basic Simple Moving Average (SMA) Crossover, this strategy identifies a "Breakout" of the OBV from its own highest-high and lowest-low channel over a recent period.
Bull Signal: Occurs when the buying pressure (OBV) is strong enough to break above its own recent highest high, indicating a potential shift to an upward trend.
Bear Signal: Occurs when the selling pressure (OBV) is intense enough to push the OBV below its own recent lowest low, indicating a potential shift to a downward trend.
On-Screen Components
1. OBV Line
This is the main indicator line, representing the cumulative volume. Its color changes to green when OBV is rising and red when it is falling.
2. Dynamic Support & Resistance Line
This is the thick Green or Red line that appears based on the strategy's current "mode." This line serves as a dynamic support/resistance level and can be used as a reference for stop-loss placement.
Green Line (Support): Appears when the strategy enters "Bull Mode." This line represents the lowest low of the OBV in the recent past and acts as dynamic support.
Red Line (Resistance): Appears when the strategy enters "Bear Mode." This line represents the highest high of the OBV in the recent past and acts as dynamic resistance.
3. Signal Markers
Bull 🔼 (Green Up Triangle): This is the "Long Entry" signal. It appears at the moment the OBV first breaks out above its high-low channel.
Bear 🔽 (Red Down Triangle): This is the "Short Entry" signal. It appears at the moment the OBV first breaks down below its high-low channel.
How to Use
Add this script to the price chart of your choice.
Navigate to the "Strategy Tester" panel at the bottom of TradingView to view the backtesting results for the strategy on different assets and timeframes.
Use the "Bull" and "Bear" signals as aids in your trading decisions.
Disclaimer: No strategy is 100% perfect. This script should always be used in conjunction with other forms of analysis, such as price structure, key price-based support/resistance levels, and your own personal risk management rules.
Inputs
SMA Length 1 / SMA Length 2: These are used to plot moving averages on the OBV for visual reference. They are part of the legacy logic and do not affect the new breakout strategy. However, they are kept for traders who may wish to observe their crossovers for additional confirmation.
High/Low Lookback Length: (Most Important Setting) This determines the period used to calculate the highest-high and lowest-low OBV channel. (Default is 30; adjust this to suit the asset's volatility).
A smaller value: Creates a narrower channel, leading to more frequent and faster signals, but potentially more false signals.
A larger value: Creates a wider channel, leading to fewer and slower signals, which are likely to be more significant.